using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using HISModels.Entities;

namespace HISModels.Mapping
{
	public class ReceiptDetailMap : EntityTypeConfiguration<ReceiptDetail>
	{
		public ReceiptDetailMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.ReceiptId)
				.IsFixedLength()
				.HasMaxLength(10);
				
			this.Property(t => t.Note)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("ReceiptDetails");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.ReceiptId).HasColumnName("ReceiptId");
			this.Property(t => t.UsingDescValue).HasColumnName("UsingDescValue");
			this.Property(t => t.CreateDescValue).HasColumnName("CreateDescValue");
			this.Property(t => t.Note).HasColumnName("Note");
			this.Property(t => t.Qty).HasColumnName("Qty");
			this.Property(t => t.DoseId).HasColumnName("DoseId");
			this.Property(t => t.ReceiptCount).HasColumnName("ReceiptCount");
		}
	}
}

